<?php 
require_once("database/db_connect.php");
require_once("graphsCommon.php");
$con = new mysqli('localhost', 'mars', 'XXXXXX', 'mars');
$startSol = 180;
$endSol = 250;

$result = $con->query("SELECT `max_temp`, `min_temp`, `sol` FROM `weather` WHERE `sol` BETWEEN ".$startSol." AND ".$endSol."");

$datay1 = array();
$datay2 = array();
$labelsArr = array();

while($row = $result->fetch_assoc()) 
{
    $datay1[] = intval($row['max_temp']);
    $datay2[] = intval($row['min_temp']);
	$labelsArr[] = intval($row['sol']);
}


plotGraph($datay1, $datay2, 'Max Temp', 'Min Temp', $labelsArr, 'Mars Temp Graph');

?>